package com.love_weinuo.ui.fragment;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.love_weinuo.R;
import com.love_weinuo.databinding.FragmentSecondBinding;
import com.love_weinuo.ui.activity.DownPidanActivity;
import com.love_weinuo.ui.activity.SendPindanActivity;
import com.love_weinuo.util.LogUtil;
/**
 * Created by Administrator
 * on 2019/2/21.
 */

public class SecondFragment extends BaseLazyFragment {

    FragmentSecondBinding binding;

    @Override
    protected View inflaterView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_second, container, false);
        binding.setFragment(this);
        return binding.getRoot();
    }

    @Override
    protected void onVisible() {
        LogUtil.e("SecondFragment的onVisible()方法");
    }

    @Override
    protected void lazyLoad() {
        binding.tvModuleDownPindan.setOnClickListener(this);
        binding.tvModuleNext.setOnClickListener(this);
    }

    @Override
    public int setLayoutId() {
        return R.layout.fragment_index;
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.tvModuleNext:
                startActivity(new Intent(getActivity(), SendPindanActivity.class));
                break;
            case R.id.tvModuleDownPindan:
                startActivity(new Intent(getActivity(), DownPidanActivity.class));
                break;
            default:
        }
    }
}